<?php

/**
 * QuestionContent form base class.
 *
 * @method QuestionContent getObject() Returns the current form's model object
 *
 * @package    iEasy
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseQuestionContentForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'question_content_id' => new sfWidgetFormInputHidden(),
      'celebrity_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Celebrity'), 'add_empty' => true)),
      'create_time'         => new sfWidgetFormDateTime(),
      'modify_time'         => new sfWidgetFormDateTime(),
      'content_type_i'      => new sfWidgetFormInputText(),
      'is_on_top_b'         => new sfWidgetFormInputText(),
      'title'               => new sfWidgetFormTextarea(),
      'system_user_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Systemuser'), 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'question_content_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('question_content_id')), 'empty_value' => $this->getObject()->get('question_content_id'), 'required' => false)),
      'celebrity_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Celebrity'), 'required' => false)),
      'create_time'         => new sfValidatorDateTime(array('required' => false)),
      'modify_time'         => new sfValidatorDateTime(array('required' => false)),
      'content_type_i'      => new sfValidatorInteger(array('required' => false)),
      'is_on_top_b'         => new sfValidatorInteger(array('required' => false)),
      'title'               => new sfValidatorString(array('required' => false)),
      'system_user_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Systemuser'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('question_content[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'QuestionContent';
  }

}
